package routers

import (
	"api_server/internal/controllers"
	"api_server/internal/middleware"

	"github.com/gin-gonic/gin"
)

func RegisteOrder(engine *gin.Engine) {
	authApi := engine.Group("auth/order").Use(middleware.VerifyToken())
	order := new(controllers.OrderController)
	authApi.POST("/create", order.CreateOrder)
	authApi.POST("/list/byduid", order.GetListByDuid)
	authApi.GET("/detail", order.GetDetailByDuid)
	authApi.POST("/pay", order.DoPay)
	engine.Any("wx/pay/callback", order.WxPayCallBack)
	//提现
	authApi.POST("/withdraw", order.CreateWithdraw)

	//获取提现信息
	authApi.GET("/withdraw/info", order.GetWithdrawInfo)
}
